// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [Audit](super::stub::Audit) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Audit<T>
where
    T: super::stub::Audit + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Audit<T>
where
    T: super::stub::Audit + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Audit for Audit<T>
where
    T: super::stub::Audit + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn generate_framework_audit_scope_report(
        &self,
        req: crate::model::GenerateFrameworkAuditScopeReportRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::GenerateFrameworkAuditScopeReportResponse>>
    {
        self.inner
            .generate_framework_audit_scope_report(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn create_framework_audit(
        &self,
        req: crate::model::CreateFrameworkAuditRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_framework_audit(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_framework_audits(
        &self,
        req: crate::model::ListFrameworkAuditsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListFrameworkAuditsResponse>> {
        self.inner.list_framework_audits(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_framework_audit(
        &self,
        req: crate::model::GetFrameworkAuditRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FrameworkAudit>> {
        self.inner.get_framework_audit(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [CmEnrollmentService](super::stub::CmEnrollmentService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct CmEnrollmentService<T>
where
    T: super::stub::CmEnrollmentService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> CmEnrollmentService<T>
where
    T: super::stub::CmEnrollmentService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::CmEnrollmentService for CmEnrollmentService<T>
where
    T: super::stub::CmEnrollmentService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn update_cm_enrollment(
        &self,
        req: crate::model::UpdateCmEnrollmentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CmEnrollment>> {
        self.inner.update_cm_enrollment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn calculate_effective_cm_enrollment(
        &self,
        req: crate::model::CalculateEffectiveCmEnrollmentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CalculateEffectiveCmEnrollmentResponse>> {
        self.inner
            .calculate_effective_cm_enrollment(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [Config](super::stub::Config) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Config<T>
where
    T: super::stub::Config + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Config<T>
where
    T: super::stub::Config + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Config for Config<T>
where
    T: super::stub::Config + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_frameworks(
        &self,
        req: crate::model::ListFrameworksRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListFrameworksResponse>> {
        self.inner.list_frameworks(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_framework(
        &self,
        req: crate::model::GetFrameworkRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Framework>> {
        self.inner.get_framework(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_framework(
        &self,
        req: crate::model::CreateFrameworkRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Framework>> {
        self.inner.create_framework(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_framework(
        &self,
        req: crate::model::UpdateFrameworkRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Framework>> {
        self.inner.update_framework(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_framework(
        &self,
        req: crate::model::DeleteFrameworkRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_framework(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_cloud_controls(
        &self,
        req: crate::model::ListCloudControlsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListCloudControlsResponse>> {
        self.inner.list_cloud_controls(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_cloud_control(
        &self,
        req: crate::model::GetCloudControlRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CloudControl>> {
        self.inner.get_cloud_control(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_cloud_control(
        &self,
        req: crate::model::CreateCloudControlRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CloudControl>> {
        self.inner.create_cloud_control(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_cloud_control(
        &self,
        req: crate::model::UpdateCloudControlRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CloudControl>> {
        self.inner.update_cloud_control(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_cloud_control(
        &self,
        req: crate::model::DeleteCloudControlRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_cloud_control(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [Deployment](super::stub::Deployment) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Deployment<T>
where
    T: super::stub::Deployment + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Deployment<T>
where
    T: super::stub::Deployment + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Deployment for Deployment<T>
where
    T: super::stub::Deployment + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_framework_deployment(
        &self,
        req: crate::model::CreateFrameworkDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_framework_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_framework_deployment(
        &self,
        req: crate::model::DeleteFrameworkDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_framework_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_framework_deployment(
        &self,
        req: crate::model::GetFrameworkDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FrameworkDeployment>> {
        self.inner.get_framework_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_framework_deployments(
        &self,
        req: crate::model::ListFrameworkDeploymentsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListFrameworkDeploymentsResponse>> {
        self.inner.list_framework_deployments(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_cloud_control_deployment(
        &self,
        req: crate::model::GetCloudControlDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CloudControlDeployment>> {
        self.inner.get_cloud_control_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_cloud_control_deployments(
        &self,
        req: crate::model::ListCloudControlDeploymentsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListCloudControlDeploymentsResponse>> {
        self.inner
            .list_cloud_control_deployments(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [Monitoring](super::stub::Monitoring) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Monitoring<T>
where
    T: super::stub::Monitoring + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Monitoring<T>
where
    T: super::stub::Monitoring + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Monitoring for Monitoring<T>
where
    T: super::stub::Monitoring + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_framework_compliance_summaries(
        &self,
        req: crate::model::ListFrameworkComplianceSummariesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListFrameworkComplianceSummariesResponse>>
    {
        self.inner
            .list_framework_compliance_summaries(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_finding_summaries(
        &self,
        req: crate::model::ListFindingSummariesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListFindingSummariesResponse>> {
        self.inner.list_finding_summaries(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn fetch_framework_compliance_report(
        &self,
        req: crate::model::FetchFrameworkComplianceReportRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FrameworkComplianceReport>> {
        self.inner
            .fetch_framework_compliance_report(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_control_compliance_summaries(
        &self,
        req: crate::model::ListControlComplianceSummariesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListControlComplianceSummariesResponse>> {
        self.inner
            .list_control_compliance_summaries(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn aggregate_framework_compliance_report(
        &self,
        req: crate::model::AggregateFrameworkComplianceReportRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::AggregateFrameworkComplianceReportResponse>>
    {
        self.inner
            .aggregate_framework_compliance_report(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}
